<template>
  <el-dialog
    :title="title"
    :visible.sync="dialogVisible"
    width="35%"
    :before-close="handleClose"
    append-to-body
  >
    <el-form ref="form" :model="form">
      <el-row>
        <el-col :span="24">
          <el-form-item label="单捆根数:" prop="workArea" label-width="120px">
            <el-input-number v-model="form.num" :min="0" :max="10" label="描述文字"></el-input-number>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="钢筋总根数:" prop="workArea" label-width="120px">
            <span>108根</span>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="全部料牌根数相加的和:" prop="workArea" label-width="180px">
            <span>108</span>
          </el-form-item>
        </el-col>
        <el-col :span="24">
          <el-table v-loading="loading" ref="multipleTable" :data="tableData" tooltip-effect="dark">
            <el-table-column prop="serialNumber" label="料单序号" align="center"></el-table-column>
            <el-table-column label="根数" align="center">
              <template slot-scope="scope">
                <el-input-number style="width: 100%;" v-model="scope.row.specifications" :min="0" :max="10" label="描述文字"></el-input-number>
              </template>
            </el-table-column>
          </el-table>
        </el-col>
      </el-row>
    </el-form>
    <span slot="footer" class="dialog-footer">
      <el-button @click="dialogVisible = false">取 消</el-button>
      <el-button type="primary" @click="submitForm">确 定</el-button>
    </span>
  </el-dialog>
</template>

<script>
export default {
  name: "",
  components: {},
  props: {},
  data() {
    return {
      dialogVisible: false,
      form: {
        num: 0
      },
      title: "",

      loading: false,
      tableData: [
        {
          serialNumber: 1,
          specifications: 2,
        }
      ],
    };
  },
  filters: {},
  computed: {},
  watch: {},
  created() {},
  mounted() {},
  beforeDestroy() {},
  methods: {
    edit(val) {
      this.dialogVisible = true;
      this.title = "料牌数量设置";
      this.$nextTick(function () {
        this.$refs.form.resetFields();
      });
      console.log(val);
    },
    submitForm() {
      this.$refs.form.validate((valid) => {
        if (valid) {
          console.log(this.form);
          this.dialogVisible = false;
        }
      });
    },
    handleClose(done) {
      this.$modal
        .confirm("确认关闭？")
        .then((_) => {
          this.dialogVisible = false;
        })
        .catch((_) => {});
    },
  },
};
</script>

<style scoped lang="scss">
</style>
